package weatherstation;

public class CurrentConditionsDisplay implements Observer, DisplayElement {

    private float temperature;
    private float humiduty;
    private Subject weatherData;

    public CurrentConditionsDisplay(Subject weatherData) {
        this.weatherData = weatherData;
        weatherData.registerObserver(this);
    }

    @Override
    public void update(float temp, float humiduty, float pressure) {
        this.temperature = temp;
        this.humiduty = humiduty;
        display();


    }

    @Override
    public void display() {
        System.out.println("Current: temp:" + temperature + "; humiduty:" + humiduty);
    }
}
